{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\mas07010\Dropbox\27 winners and losers and election quality\pop second revision\lapop models.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}30 Jul 2021, 15:31:18
{txt}
{com}. 
. label define loser 1 "Did Not Vote for the President's Party" 0 "Voted for the President's Party", replace
{txt}
{com}. label values loser loser
{txt}
{com}. 
. ** model democratic satisfaction
. 
. mixed dem_sat C.v2x_poly loser abstainer wt_grow ur edu quintall female  age2635 age3645 age4655 age5665 age66 mestizo indigen black mulatto oth_race || pais: || level2: loser abstainer
{res}
{txt}Performing EM optimization ...
{res}
{txt}Performing gradient-based optimization: {res}
{txt}Iteration 0:{space 3}log likelihood = {res:-155829.28}  
Iteration 1:{space 3}log likelihood = {res:-155829.28}  
{res}
{txt}Computing standard errors ...
{res}
{txt}Mixed-effects ML regression{col 49}Number of obs{col 67}={col 69}{res}   145,973

{txt}{col 9}Grouping information
{col 9}{hline 16}{c TT}{hline 44}
{col 25}{c |}{col 31}No. of{col 44}Observations per group
{col 10}Group variable{col 25}{c |}{col 31}groups{col 41}Minimum{col 52}Average{col 63}Maximum
{col 9}{hline 16}{c +}{hline 44}
{res}{col 20}pais{txt}{col 25}{c |}{res}{col 29}      18{col 39}    6,115{col 50}  8,109.6{col 61}   12,505
{col 18}level2{txt}{col 25}{c |}{res}{col 29}     120{col 39}      488{col 50}  1,216.4{col 61}    2,774
{txt}{col 9}{hline 16}{c BT}{hline 44}

{col 49}Wald chi2({res}18{txt}){col 67}={col 70}{res}  1288.82
{txt}Log likelihood = {res}-155829.28{col 49}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}     dem_sat{col 14}{c |} Coefficient{col 26}  Std. err.{col 38}      z{col 46}   P>|z|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 4}v2x_poly {c |}{col 14}{res}{space 2} -.095603{col 26}{space 2} .1951496{col 37}{space 1}   -0.49{col 46}{space 3}0.624{col 54}{space 4}-.4780893{col 67}{space 3} .2868832
{txt}{space 7}loser {c |}{col 14}{res}{space 2}-.2400391{col 26}{space 2} .0193565{col 37}{space 1}  -12.40{col 46}{space 3}0.000{col 54}{space 4}-.2779771{col 67}{space 3}-.2021011
{txt}{space 3}abstainer {c |}{col 14}{res}{space 2} -.158072{col 26}{space 2} .0118096{col 37}{space 1}  -13.39{col 46}{space 3}0.000{col 54}{space 4}-.1812184{col 67}{space 3}-.1349256
{txt}{space 5}wt_grow {c |}{col 14}{res}{space 2} .0156435{col 26}{space 2} .0053915{col 37}{space 1}    2.90{col 46}{space 3}0.004{col 54}{space 4} .0050764{col 67}{space 3} .0262106
{txt}{space 10}ur {c |}{col 14}{res}{space 2} .0675577{col 26}{space 2} .0044328{col 37}{space 1}   15.24{col 46}{space 3}0.000{col 54}{space 4} .0588695{col 67}{space 3} .0762458
{txt}{space 9}edu {c |}{col 14}{res}{space 2}  -.00616{col 26}{space 2} .0005272{col 37}{space 1}  -11.68{col 46}{space 3}0.000{col 54}{space 4}-.0071933{col 67}{space 3}-.0051267
{txt}{space 4}quintall {c |}{col 14}{res}{space 2}-.0030768{col 26}{space 2} .0014457{col 37}{space 1}   -2.13{col 46}{space 3}0.033{col 54}{space 4}-.0059102{col 67}{space 3}-.0002433
{txt}{space 6}female {c |}{col 14}{res}{space 2}-.0384766{col 26}{space 2} .0037017{col 37}{space 1}  -10.39{col 46}{space 3}0.000{col 54}{space 4}-.0457317{col 67}{space 3}-.0312214
{txt}{space 5}age2635 {c |}{col 14}{res}{space 2}-.0506064{col 26}{space 2} .0054521{col 37}{space 1}   -9.28{col 46}{space 3}0.000{col 54}{space 4}-.0612922{col 67}{space 3}-.0399205
{txt}{space 5}age3645 {c |}{col 14}{res}{space 2}-.0505473{col 26}{space 2} .0058252{col 37}{space 1}   -8.68{col 46}{space 3}0.000{col 54}{space 4}-.0619645{col 67}{space 3}-.0391302
{txt}{space 5}age4655 {c |}{col 14}{res}{space 2}-.0498969{col 26}{space 2} .0064275{col 37}{space 1}   -7.76{col 46}{space 3}0.000{col 54}{space 4}-.0624946{col 67}{space 3}-.0372993
{txt}{space 5}age5665 {c |}{col 14}{res}{space 2}-.0353242{col 26}{space 2}  .007345{col 37}{space 1}   -4.81{col 46}{space 3}0.000{col 54}{space 4}-.0497202{col 67}{space 3}-.0209282
{txt}{space 7}age66 {c |}{col 14}{res}{space 2} .0197131{col 26}{space 2} .0082444{col 37}{space 1}    2.39{col 46}{space 3}0.017{col 54}{space 4} .0035544{col 67}{space 3} .0358717
{txt}{space 5}mestizo {c |}{col 14}{res}{space 2}-.0313063{col 26}{space 2} .0048013{col 37}{space 1}   -6.52{col 46}{space 3}0.000{col 54}{space 4}-.0407166{col 67}{space 3} -.021896
{txt}{space 5}indigen {c |}{col 14}{res}{space 2} -.005387{col 26}{space 2} .0086246{col 37}{space 1}   -0.62{col 46}{space 3}0.532{col 54}{space 4}-.0222909{col 67}{space 3}  .011517
{txt}{space 7}black {c |}{col 14}{res}{space 2}-.0347532{col 26}{space 2} .0095719{col 37}{space 1}   -3.63{col 46}{space 3}0.000{col 54}{space 4}-.0535138{col 67}{space 3}-.0159927
{txt}{space 5}mulatto {c |}{col 14}{res}{space 2}-.0405683{col 26}{space 2} .0098448{col 37}{space 1}   -4.12{col 46}{space 3}0.000{col 54}{space 4}-.0598638{col 67}{space 3}-.0212728
{txt}{space 4}oth_race {c |}{col 14}{res}{space 2}-.0364331{col 26}{space 2} .0126618{col 37}{space 1}   -2.88{col 46}{space 3}0.004{col 54}{space 4}-.0612498{col 67}{space 3}-.0116163
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 1.655258{col 26}{space 2} .1353753{col 37}{space 1}   12.23{col 46}{space 3}0.000{col 54}{space 4} 1.389927{col 67}{space 3} 1.920588
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{hline 29}{c TT}{hline 48}
{col 3}Random-effects parameters{col 30}{c |}{col 34}Estimate{col 45}Std. err.{col 59}[95% conf. interval]
{hline 29}{c +}{hline 48}
{res}pais{txt}: Identity{col 30}{c |}
{space 18}var(_cons) {c |}{res}{col 33} .0181557{col 44} .0080079{col 58} .0076485{col 70} .0430972
{txt}{hline 29}{c +}{hline 48}
{res}level2{txt}: Independent{col 30}{c |}
{space 18}var(loser) {c |}{res}{col 33}  .041875{col 44} .0058109{col 58} .0319033{col 70} .0549635
{txt}{space 14}var(abstainer) {c |}{res}{col 33}  .013798{col 44}  .002154{col 58}  .010161{col 70} .0187368
{txt}{space 18}var(_cons) {c |}{res}{col 33}   .03104{col 44} .0045098{col 58}  .023348{col 70}  .041266
{txt}{hline 29}{c +}{hline 48}
{col 16}var(Residual){col 30}{c |}{res}{col 33}  .491385{col 44} .0018213{col 58} .4878283{col 70} .4949677
{txt}{hline 29}{c BT}{hline 48}
LR test vs. linear model:{col 27}chi2({res}4{txt}) = {res}10739.37{col 59}{txt}Prob > chi2 ={col 73}{res}0.0000

{txt}{p 0 6 4}Note: {help j_mixedlr##|_new:LR test is conservative} and provided only for reference.{p_end}

{com}.  
. mixed dem_sat C.v2x_poly##C.loser abstainer##C.v2x_poly  wt_grow ur edu quintall female  age2635 age3645 age4655 age5665 age66 mestizo indigen black mulatto oth_race || pais: || level2: loser abstainer
{txt}note: {bf:v2x_poly} omitted because of collinearity.
{res}
{txt}Performing EM optimization ...
{res}
{txt}Performing gradient-based optimization: {res}
{txt}Iteration 0:{space 3}log likelihood = {res:-155803.83}  
Iteration 1:{space 3}log likelihood = {res:-155803.83}  
{res}
{txt}Computing standard errors ...
{res}
{txt}Mixed-effects ML regression{col 49}Number of obs{col 67}={col 69}{res}   145,973

{txt}{col 9}Grouping information
{col 9}{hline 16}{c TT}{hline 44}
{col 25}{c |}{col 31}No. of{col 44}Observations per group
{col 10}Group variable{col 25}{c |}{col 31}groups{col 41}Minimum{col 52}Average{col 63}Maximum
{col 9}{hline 16}{c +}{hline 44}
{res}{col 20}pais{txt}{col 25}{c |}{res}{col 29}      18{col 39}    6,115{col 50}  8,109.6{col 61}   12,505
{col 18}level2{txt}{col 25}{c |}{res}{col 29}     120{col 39}      488{col 50}  1,216.4{col 61}    2,774
{txt}{col 9}{hline 16}{c BT}{hline 44}

{col 49}Wald chi2({res}20{txt}){col 67}={col 70}{res}  1425.58
{txt}Log likelihood = {res}-155803.83{col 49}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{hline 21}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}             dem_sat{col 22}{c |} Coefficient{col 34}  Std. err.{col 46}      z{col 54}   P>|z|{col 62}     [95% con{col 75}f. interval]
{hline 21}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 12}v2x_poly {c |}{col 22}{res}{space 2}-.1219281{col 34}{space 2} .1935549{col 45}{space 1}   -0.63{col 54}{space 3}0.529{col 62}{space 4}-.5012887{col 75}{space 3} .2574325
{txt}{space 15}loser {c |}{col 22}{res}{space 2} -.733877{col 34}{space 2} .0712484{col 45}{space 1}  -10.30{col 54}{space 3}0.000{col 62}{space 4}-.8735214{col 75}{space 3}-.5942327
{txt}{space 20} {c |}
{space 2}c.v2x_poly#c.loser {c |}{col 22}{res}{space 2} .7248547{col 34}{space 2} .1017654{col 45}{space 1}    7.12{col 54}{space 3}0.000{col 62}{space 4} .5253982{col 75}{space 3} .9243112
{txt}{space 20} {c |}
{space 9}1.abstainer {c |}{col 22}{res}{space 2}-.3130393{col 34}{space 2} .0487524{col 45}{space 1}   -6.42{col 54}{space 3}0.000{col 62}{space 4}-.4085923{col 75}{space 3}-.2174863
{txt}{space 12}v2x_poly {c |}{col 22}{res}{space 2}        0{col 34}{txt}  (omitted)
{space 20} {c |}
abstainer#c.v2x_poly {c |}
{space 18}1  {c |}{col 22}{res}{space 2} .2282405{col 34}{space 2} .0699148{col 45}{space 1}    3.26{col 54}{space 3}0.001{col 62}{space 4} .0912099{col 75}{space 3} .3652711
{txt}{space 20} {c |}
{space 13}wt_grow {c |}{col 22}{res}{space 2} .0155035{col 34}{space 2} .0053751{col 45}{space 1}    2.88{col 54}{space 3}0.004{col 62}{space 4} .0049684{col 75}{space 3} .0260386
{txt}{space 18}ur {c |}{col 22}{res}{space 2} .0675445{col 34}{space 2} .0044326{col 45}{space 1}   15.24{col 54}{space 3}0.000{col 62}{space 4} .0588567{col 75}{space 3} .0762323
{txt}{space 17}edu {c |}{col 22}{res}{space 2}-.0061508{col 34}{space 2} .0005272{col 45}{space 1}  -11.67{col 54}{space 3}0.000{col 62}{space 4} -.007184{col 75}{space 3}-.0051175
{txt}{space 12}quintall {c |}{col 22}{res}{space 2}-.0030487{col 34}{space 2} .0014456{col 45}{space 1}   -2.11{col 54}{space 3}0.035{col 62}{space 4}-.0058821{col 75}{space 3}-.0002153
{txt}{space 14}female {c |}{col 22}{res}{space 2}-.0385386{col 34}{space 2} .0037016{col 45}{space 1}  -10.41{col 54}{space 3}0.000{col 62}{space 4}-.0457935{col 75}{space 3}-.0312836
{txt}{space 13}age2635 {c |}{col 22}{res}{space 2}-.0506192{col 34}{space 2} .0054517{col 45}{space 1}   -9.29{col 54}{space 3}0.000{col 62}{space 4}-.0613043{col 75}{space 3} -.039934
{txt}{space 13}age3645 {c |}{col 22}{res}{space 2}-.0505093{col 34}{space 2} .0058248{col 45}{space 1}   -8.67{col 54}{space 3}0.000{col 62}{space 4}-.0619258{col 75}{space 3}-.0390929
{txt}{space 13}age4655 {c |}{col 22}{res}{space 2} -.049752{col 34}{space 2} .0064272{col 45}{space 1}   -7.74{col 54}{space 3}0.000{col 62}{space 4}-.0623492{col 75}{space 3}-.0371549
{txt}{space 13}age5665 {c |}{col 22}{res}{space 2}  -.03518{col 34}{space 2} .0073448{col 45}{space 1}   -4.79{col 54}{space 3}0.000{col 62}{space 4}-.0495755{col 75}{space 3}-.0207844
{txt}{space 15}age66 {c |}{col 22}{res}{space 2} .0197584{col 34}{space 2} .0082439{col 45}{space 1}    2.40{col 54}{space 3}0.017{col 62}{space 4} .0036007{col 75}{space 3} .0359161
{txt}{space 13}mestizo {c |}{col 22}{res}{space 2}-.0313549{col 34}{space 2} .0048012{col 45}{space 1}   -6.53{col 54}{space 3}0.000{col 62}{space 4} -.040765{col 75}{space 3}-.0219447
{txt}{space 13}indigen {c |}{col 22}{res}{space 2}-.0053169{col 34}{space 2} .0086239{col 45}{space 1}   -0.62{col 54}{space 3}0.538{col 62}{space 4}-.0222195{col 75}{space 3} .0115857
{txt}{space 15}black {c |}{col 22}{res}{space 2}-.0347712{col 34}{space 2} .0095717{col 45}{space 1}   -3.63{col 54}{space 3}0.000{col 62}{space 4}-.0535313{col 75}{space 3} -.016011
{txt}{space 13}mulatto {c |}{col 22}{res}{space 2}-.0403804{col 34}{space 2} .0098445{col 45}{space 1}   -4.10{col 54}{space 3}0.000{col 62}{space 4}-.0596753{col 75}{space 3}-.0210855
{txt}{space 12}oth_race {c |}{col 22}{res}{space 2}-.0363147{col 34}{space 2} .0126617{col 45}{space 1}   -2.87{col 54}{space 3}0.004{col 62}{space 4}-.0611312{col 75}{space 3}-.0114982
{txt}{space 15}_cons {c |}{col 22}{res}{space 2} 1.673605{col 34}{space 2} .1342467{col 45}{space 1}   12.47{col 54}{space 3}0.000{col 62}{space 4} 1.410487{col 75}{space 3} 1.936724
{txt}{hline 21}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{hline 29}{c TT}{hline 48}
{col 3}Random-effects parameters{col 30}{c |}{col 34}Estimate{col 45}Std. err.{col 59}[95% conf. interval]
{hline 29}{c +}{hline 48}
{res}pais{txt}: Identity{col 30}{c |}
{space 18}var(_cons) {c |}{res}{col 33} .0176523{col 44} .0078196{col 58} .0074086{col 70} .0420596
{txt}{hline 29}{c +}{hline 48}
{res}level2{txt}: Independent{col 30}{c |}
{space 18}var(loser) {c |}{res}{col 33} .0287324{col 44} .0041076{col 58} .0217112{col 70} .0380241
{txt}{space 14}var(abstainer) {c |}{res}{col 33} .0123649{col 44} .0019592{col 58}  .009064{col 70}  .016868
{txt}{space 18}var(_cons) {c |}{res}{col 33} .0308982{col 44} .0044871{col 58} .0232445{col 70} .0410721
{txt}{hline 29}{c +}{hline 48}
{col 16}var(Residual){col 30}{c |}{res}{col 33} .4913937{col 44} .0018214{col 58} .4878368{col 70} .4949765
{txt}{hline 29}{c BT}{hline 48}
LR test vs. linear model:{col 27}chi2({res}4{txt}) = {res}10108.72{col 59}{txt}Prob > chi2 ={col 73}{res}0.0000

{txt}{p 0 6 4}Note: {help j_mixedlr##|_new:LR test is conservative} and provided only for reference.{p_end}

{com}. 
. quietly: margins , at(v2x_poly=(0.25(.05).95) loser=(0(1)1) abstainer=0 wt_grow=(3.65) ur=1 edu=9.37 quintall=2.957 female=1  age2635=1 age3645=0 age4655=0 age5665=0 age66=0 mestizo=1 indigen=0 black=0 mulatto=0 oth_race=0)
{txt}
{com}. marginsplot, recast(line) recastci(rline) xtitle( "Level of Democracy (V-Dem)") ytitle("Predicted Democratic Satisfaction") title("Satisfaction with Democracy") ciopts(lpattern(dash) lcolor(gs8)) ci2opts(lpattern(dash)) scheme(s1mono) plot2opts(lpattern(line) lcolor(black)) plotopts(lpattern(line) lcolor(gs8)) legend(rows(2))
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:v2x_poly loser}{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{res}{txt}
{com}. graph save "Graph" "C:\Users\mas07010\Dropbox\27 winners and losers and election quality\pop second revision\figure 3 democratic satisfaction.gph", replace
{res}{txt}file {bf:C:\Users\mas07010\Dropbox\27 winners and losers and election quality\pop second revision\figure 3 democratic satisfaction.gph} saved

{com}. 
. *note that the graphs will not do the full range of the variable automatically. So I change the y-axis range by hand
. 
. **model if country is democratic
. 
. mixed pais_dem C.v2x_poly loser abstainer wt_grow ur edu quintall female  age2635 age3645 age4655 age5665 age66 mestizo indigen black mulatto oth_race || pais: || level2: loser abstainer
{res}
{txt}Performing EM optimization ...
{res}
{txt}Performing gradient-based optimization: {res}
{txt}Iteration 0:{space 3}log likelihood = {res:-98792.361}  
Iteration 1:{space 3}log likelihood = {res:-98792.361}  
{res}
{txt}Computing standard errors ...
{res}
{txt}Mixed-effects ML regression{col 49}Number of obs{col 67}={col 69}{res}    84,049

{txt}{col 9}Grouping information
{col 9}{hline 16}{c TT}{hline 44}
{col 25}{c |}{col 31}No. of{col 44}Observations per group
{col 10}Group variable{col 25}{c |}{col 31}groups{col 41}Minimum{col 52}Average{col 63}Maximum
{col 9}{hline 16}{c +}{hline 44}
{res}{col 20}pais{txt}{col 25}{c |}{res}{col 29}      18{col 39}    2,781{col 50}  4,669.4{col 61}    8,858
{col 18}level2{txt}{col 25}{c |}{res}{col 29}      70{col 39}      495{col 50}  1,200.7{col 61}    2,774
{txt}{col 9}{hline 16}{c BT}{hline 44}

{col 49}Wald chi2({res}18{txt}){col 67}={col 70}{res}   289.38
{txt}Log likelihood = {res}-98792.361{col 49}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}    pais_dem{col 14}{c |} Coefficient{col 26}  Std. err.{col 38}      z{col 46}   P>|z|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 4}v2x_poly {c |}{col 14}{res}{space 2}-.2751831{col 26}{space 2}  .302523{col 37}{space 1}   -0.91{col 46}{space 3}0.363{col 54}{space 4}-.8681172{col 67}{space 3}  .317751
{txt}{space 7}loser {c |}{col 14}{res}{space 2}-.2742644{col 26}{space 2} .0330575{col 37}{space 1}   -8.30{col 46}{space 3}0.000{col 54}{space 4}-.3390559{col 67}{space 3}-.2094729
{txt}{space 3}abstainer {c |}{col 14}{res}{space 2} -.192423{col 26}{space 2} .0183433{col 37}{space 1}  -10.49{col 46}{space 3}0.000{col 54}{space 4}-.2283753{col 67}{space 3}-.1564707
{txt}{space 5}wt_grow {c |}{col 14}{res}{space 2} .0068289{col 26}{space 2} .0055505{col 37}{space 1}    1.23{col 46}{space 3}0.219{col 54}{space 4}-.0040499{col 67}{space 3} .0177076
{txt}{space 10}ur {c |}{col 14}{res}{space 2}  .028017{col 26}{space 2} .0064815{col 37}{space 1}    4.32{col 46}{space 3}0.000{col 54}{space 4} .0153135{col 67}{space 3} .0407206
{txt}{space 9}edu {c |}{col 14}{res}{space 2} .0015628{col 26}{space 2} .0007667{col 37}{space 1}    2.04{col 46}{space 3}0.042{col 54}{space 4} .0000601{col 67}{space 3} .0030656
{txt}{space 4}quintall {c |}{col 14}{res}{space 2} .0037869{col 26}{space 2} .0021165{col 37}{space 1}    1.79{col 46}{space 3}0.074{col 54}{space 4}-.0003614{col 67}{space 3} .0079352
{txt}{space 6}female {c |}{col 14}{res}{space 2}-.0181752{col 26}{space 2} .0054318{col 37}{space 1}   -3.35{col 46}{space 3}0.001{col 54}{space 4}-.0288212{col 67}{space 3}-.0075292
{txt}{space 5}age2635 {c |}{col 14}{res}{space 2} -.019269{col 26}{space 2}  .007914{col 37}{space 1}   -2.43{col 46}{space 3}0.015{col 54}{space 4}-.0347801{col 67}{space 3}-.0037579
{txt}{space 5}age3645 {c |}{col 14}{res}{space 2} .0168015{col 26}{space 2} .0084565{col 37}{space 1}    1.99{col 46}{space 3}0.047{col 54}{space 4} .0002269{col 67}{space 3}  .033376
{txt}{space 5}age4655 {c |}{col 14}{res}{space 2}  .005714{col 26}{space 2} .0094018{col 37}{space 1}    0.61{col 46}{space 3}0.543{col 54}{space 4}-.0127133{col 67}{space 3} .0241413
{txt}{space 5}age5665 {c |}{col 14}{res}{space 2} .0361637{col 26}{space 2} .0108471{col 37}{space 1}    3.33{col 46}{space 3}0.001{col 54}{space 4} .0149037{col 67}{space 3} .0574236
{txt}{space 7}age66 {c |}{col 14}{res}{space 2} .0712178{col 26}{space 2} .0124643{col 37}{space 1}    5.71{col 46}{space 3}0.000{col 54}{space 4} .0467882{col 67}{space 3} .0956473
{txt}{space 5}mestizo {c |}{col 14}{res}{space 2} .0002435{col 26}{space 2} .0070316{col 37}{space 1}    0.03{col 46}{space 3}0.972{col 54}{space 4}-.0135382{col 67}{space 3} .0140253
{txt}{space 5}indigen {c |}{col 14}{res}{space 2} -.010986{col 26}{space 2} .0132531{col 37}{space 1}   -0.83{col 46}{space 3}0.407{col 54}{space 4}-.0369615{col 67}{space 3} .0149896
{txt}{space 7}black {c |}{col 14}{res}{space 2} .0099532{col 26}{space 2} .0147693{col 37}{space 1}    0.67{col 46}{space 3}0.500{col 54}{space 4}-.0189941{col 67}{space 3} .0389005
{txt}{space 5}mulatto {c |}{col 14}{res}{space 2}-.0165837{col 26}{space 2} .0156185{col 37}{space 1}   -1.06{col 46}{space 3}0.288{col 54}{space 4}-.0471953{col 67}{space 3} .0140279
{txt}{space 4}oth_race {c |}{col 14}{res}{space 2}-.0274689{col 26}{space 2} .0222524{col 37}{space 1}   -1.23{col 46}{space 3}0.217{col 54}{space 4}-.0710829{col 67}{space 3} .0161451
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 2.007258{col 26}{space 2} .2126041{col 37}{space 1}    9.44{col 46}{space 3}0.000{col 54}{space 4} 1.590562{col 67}{space 3} 2.423955
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{hline 29}{c TT}{hline 48}
{col 3}Random-effects parameters{col 30}{c |}{col 34}Estimate{col 45}Std. err.{col 59}[95% conf. interval]
{hline 29}{c +}{hline 48}
{res}pais{txt}: Identity{col 30}{c |}
{space 18}var(_cons) {c |}{res}{col 33} .0630989{col 44} .0258477{col 58} .0282708{col 70} .1408334
{txt}{hline 29}{c +}{hline 48}
{res}level2{txt}: Independent{col 30}{c |}
{space 18}var(loser) {c |}{res}{col 33} .0723673{col 44} .0129774{col 58} .0509213{col 70} .1028455
{txt}{space 14}var(abstainer) {c |}{res}{col 33} .0196737{col 44} .0039423{col 58} .0132836{col 70} .0291376
{txt}{space 18}var(_cons) {c |}{res}{col 33} .0247147{col 44} .0052787{col 58} .0162611{col 70}  .037563
{txt}{hline 29}{c +}{hline 48}
{col 16}var(Residual){col 30}{c |}{res}{col 33}  .609541{col 44} .0029773{col 58} .6037333{col 70} .6154045
{txt}{hline 29}{c BT}{hline 48}
LR test vs. linear model:{col 27}chi2({res}4{txt}) = {res}7781.96{col 59}{txt}Prob > chi2 ={col 73}{res}0.0000

{txt}{p 0 6 4}Note: {help j_mixedlr##|_new:LR test is conservative} and provided only for reference.{p_end}

{com}. 
. mixed pais_dem C.v2x_poly##C.loser abstainer##C.v2x_poly  wt_grow ur edu quintall female  age2635 age3645 age4655 age5665 age66 mestizo indigen black mulatto oth_race || pais: || level2: loser abstainer
{txt}note: {bf:v2x_poly} omitted because of collinearity.
{res}
{txt}Performing EM optimization ...
{res}
{txt}Performing gradient-based optimization: {res}
{txt}Iteration 0:{space 3}log likelihood = {res: -98767.64}  
Iteration 1:{space 3}log likelihood = {res: -98767.64}  
{res}
{txt}Computing standard errors ...
{res}
{txt}Mixed-effects ML regression{col 49}Number of obs{col 67}={col 69}{res}    84,049

{txt}{col 9}Grouping information
{col 9}{hline 16}{c TT}{hline 44}
{col 25}{c |}{col 31}No. of{col 44}Observations per group
{col 10}Group variable{col 25}{c |}{col 31}groups{col 41}Minimum{col 52}Average{col 63}Maximum
{col 9}{hline 16}{c +}{hline 44}
{res}{col 20}pais{txt}{col 25}{c |}{res}{col 29}      18{col 39}    2,781{col 50}  4,669.4{col 61}    8,858
{col 18}level2{txt}{col 25}{c |}{res}{col 29}      70{col 39}      495{col 50}  1,200.7{col 61}    2,774
{txt}{col 9}{hline 16}{c BT}{hline 44}

{col 49}Wald chi2({res}20{txt}){col 67}={col 70}{res}   416.19
{txt}Log likelihood = {res} -98767.64{col 49}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{hline 21}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}            pais_dem{col 22}{c |} Coefficient{col 34}  Std. err.{col 46}      z{col 54}   P>|z|{col 62}     [95% con{col 75}f. interval]
{hline 21}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 12}v2x_poly {c |}{col 22}{res}{space 2} -.315496{col 34}{space 2} .2998955{col 45}{space 1}   -1.05{col 54}{space 3}0.293{col 62}{space 4}-.9032804{col 75}{space 3} .2722884
{txt}{space 15}loser {c |}{col 22}{res}{space 2}-.9733083{col 34}{space 2}  .107054{col 45}{space 1}   -9.09{col 54}{space 3}0.000{col 62}{space 4} -1.18313{col 75}{space 3}-.7634862
{txt}{space 20} {c |}
{space 2}c.v2x_poly#c.loser {c |}{col 22}{res}{space 2} 1.035902{col 34}{space 2} .1537915{col 45}{space 1}    6.74{col 54}{space 3}0.000{col 62}{space 4} .7344765{col 75}{space 3} 1.337328
{txt}{space 20} {c |}
{space 9}1.abstainer {c |}{col 22}{res}{space 2}-.4646819{col 34}{space 2} .0665073{col 45}{space 1}   -6.99{col 54}{space 3}0.000{col 62}{space 4}-.5950337{col 75}{space 3}  -.33433
{txt}{space 12}v2x_poly {c |}{col 22}{res}{space 2}        0{col 34}{txt}  (omitted)
{space 20} {c |}
abstainer#c.v2x_poly {c |}
{space 18}1  {c |}{col 22}{res}{space 2} .4053239{col 34}{space 2}  .096142{col 45}{space 1}    4.22{col 54}{space 3}0.000{col 62}{space 4}  .216889{col 75}{space 3} .5937589
{txt}{space 20} {c |}
{space 13}wt_grow {c |}{col 22}{res}{space 2} .0067127{col 34}{space 2} .0055176{col 45}{space 1}    1.22{col 54}{space 3}0.224{col 62}{space 4}-.0041017{col 75}{space 3} .0175271
{txt}{space 18}ur {c |}{col 22}{res}{space 2} .0281369{col 34}{space 2} .0064812{col 45}{space 1}    4.34{col 54}{space 3}0.000{col 62}{space 4} .0154341{col 75}{space 3} .0408398
{txt}{space 17}edu {c |}{col 22}{res}{space 2} .0015628{col 34}{space 2} .0007667{col 45}{space 1}    2.04{col 54}{space 3}0.041{col 62}{space 4} .0000602{col 75}{space 3} .0030655
{txt}{space 12}quintall {c |}{col 22}{res}{space 2} .0038078{col 34}{space 2} .0021164{col 45}{space 1}    1.80{col 54}{space 3}0.072{col 62}{space 4}-.0003402{col 75}{space 3} .0079559
{txt}{space 14}female {c |}{col 22}{res}{space 2}-.0181417{col 34}{space 2} .0054314{col 45}{space 1}   -3.34{col 54}{space 3}0.001{col 62}{space 4}-.0287871{col 75}{space 3}-.0074962
{txt}{space 13}age2635 {c |}{col 22}{res}{space 2}-.0194033{col 34}{space 2} .0079129{col 45}{space 1}   -2.45{col 54}{space 3}0.014{col 62}{space 4}-.0349123{col 75}{space 3}-.0038943
{txt}{space 13}age3645 {c |}{col 22}{res}{space 2} .0168021{col 34}{space 2} .0084553{col 45}{space 1}    1.99{col 54}{space 3}0.047{col 62}{space 4}   .00023{col 75}{space 3} .0333741
{txt}{space 13}age4655 {c |}{col 22}{res}{space 2} .0059137{col 34}{space 2} .0094006{col 45}{space 1}    0.63{col 54}{space 3}0.529{col 62}{space 4}-.0125113{col 75}{space 3} .0243386
{txt}{space 13}age5665 {c |}{col 22}{res}{space 2} .0363087{col 34}{space 2} .0108459{col 45}{space 1}    3.35{col 54}{space 3}0.001{col 62}{space 4} .0150511{col 75}{space 3} .0575662
{txt}{space 15}age66 {c |}{col 22}{res}{space 2} .0713029{col 34}{space 2} .0124621{col 45}{space 1}    5.72{col 54}{space 3}0.000{col 62}{space 4} .0468775{col 75}{space 3} .0957283
{txt}{space 13}mestizo {c |}{col 22}{res}{space 2} .0001801{col 34}{space 2} .0070314{col 45}{space 1}    0.03{col 54}{space 3}0.980{col 62}{space 4}-.0136011{col 75}{space 3} .0139614
{txt}{space 13}indigen {c |}{col 22}{res}{space 2}-.0108484{col 34}{space 2} .0132511{col 45}{space 1}   -0.82{col 54}{space 3}0.413{col 62}{space 4}-.0368202{col 75}{space 3} .0151233
{txt}{space 15}black {c |}{col 22}{res}{space 2} .0101435{col 34}{space 2} .0147688{col 45}{space 1}    0.69{col 54}{space 3}0.492{col 62}{space 4}-.0188028{col 75}{space 3} .0390897
{txt}{space 13}mulatto {c |}{col 22}{res}{space 2}-.0160897{col 34}{space 2} .0156177{col 45}{space 1}   -1.03{col 54}{space 3}0.303{col 62}{space 4}-.0466998{col 75}{space 3} .0145203
{txt}{space 12}oth_race {c |}{col 22}{res}{space 2}-.0273847{col 34}{space 2} .0222519{col 45}{space 1}   -1.23{col 54}{space 3}0.218{col 62}{space 4}-.0709976{col 75}{space 3} .0162282
{txt}{space 15}_cons {c |}{col 22}{res}{space 2} 2.035334{col 34}{space 2} .2107007{col 45}{space 1}    9.66{col 54}{space 3}0.000{col 62}{space 4} 1.622369{col 75}{space 3}   2.4483
{txt}{hline 21}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{hline 29}{c TT}{hline 48}
{col 3}Random-effects parameters{col 30}{c |}{col 34}Estimate{col 45}Std. err.{col 59}[95% conf. interval]
{hline 29}{c +}{hline 48}
{res}pais{txt}: Identity{col 30}{c |}
{space 18}var(_cons) {c |}{res}{col 33} .0615229{col 44} .0252798{col 58} .0274965{col 70} .1376564
{txt}{hline 29}{c +}{hline 48}
{res}level2{txt}: Independent{col 30}{c |}
{space 18}var(loser) {c |}{res}{col 33} .0429203{col 44} .0079163{col 58} .0298996{col 70} .0616112
{txt}{space 14}var(abstainer) {c |}{res}{col 33} .0150346{col 44} .0031279{col 58}      .01{col 70} .0226039
{txt}{space 18}var(_cons) {c |}{res}{col 33}  .024455{col 44} .0052206{col 58} .0160936{col 70} .0371605
{txt}{hline 29}{c +}{hline 48}
{col 16}var(Residual){col 30}{c |}{res}{col 33} .6095504{col 44} .0029774{col 58} .6037426{col 70} .6154141
{txt}{hline 29}{c BT}{hline 48}
LR test vs. linear model:{col 27}chi2({res}4{txt}) = {res}7159.89{col 59}{txt}Prob > chi2 ={col 73}{res}0.0000

{txt}{p 0 6 4}Note: {help j_mixedlr##|_new:LR test is conservative} and provided only for reference.{p_end}

{com}. 
. quietly: margins , at(v2x_poly=(0.25(.05).95) loser=(0(1)1) abstainer=0 wt_grow=(3.65) ur=1 edu=9.37 quintall=2.957 female=1  age2635=1 age3645=0 age4655=0 age5665=0 age66=0 mestizo=1 indigen=0 black=0 mulatto=0 oth_race=0)
{txt}
{com}. marginsplot, recast(line) recastci(rline) xtitle( "Level of Democracy (V-Dem)") ytitle("Predicted Level of Democracy in Country") title("Country is Democratic") ciopts(lpattern(dash) lcolor(gs8)) ci2opts(lpattern(dash)) scheme(s1mono) plot2opts(lpattern(line) lcolor(black)) plotopts(lpattern(line) lcolor(gs8)) legend(rows(2))
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:v2x_poly loser}{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{res}{txt}
{com}. graph save "Graph" "C:\Users\mas07010\Dropbox\27 winners and losers and election quality\pop second revision\figure 3 country is democratic.gph", replace
{txt}{p 0 4 2}
(file {bf}
C:\Users\mas07010\Dropbox\27 winners and losers and election quality\pop second revision\figure 3 country is democratic.gph{rm}
not found)
{p_end}
{res}{txt}file {bf:C:\Users\mas07010\Dropbox\27 winners and losers and election quality\pop second revision\figure 3 country is democratic.gph} saved

{com}. 
. ** model trust in the electoral system
. 
. mixed b11 C.v2x_poly loser abstainer wt_grow ur edu quintall female  age2635 age3645 age4655 age5665 age66 mestizo indigen black mulatto oth_race || pais: || level2: loser abstainer 
{res}
{txt}Performing EM optimization ...
{res}
{txt}Performing gradient-based optimization: {res}
{txt}Iteration 0:{space 3}log likelihood = {res:-218364.51}  
Iteration 1:{space 3}log likelihood = {res:-218364.51}  
{res}
{txt}Computing standard errors ...
{res}
{txt}Mixed-effects ML regression{col 49}Number of obs{col 67}={col 69}{res}   109,618

{txt}{col 9}Grouping information
{col 9}{hline 16}{c TT}{hline 44}
{col 25}{c |}{col 31}No. of{col 44}Observations per group
{col 10}Group variable{col 25}{c |}{col 31}groups{col 41}Minimum{col 52}Average{col 63}Maximum
{col 9}{hline 16}{c +}{hline 44}
{res}{col 20}pais{txt}{col 25}{c |}{res}{col 29}      18{col 39}    3,254{col 50}  6,089.9{col 61}   10,792
{col 18}level2{txt}{col 25}{c |}{res}{col 29}      82{col 39}      892{col 50}  1,336.8{col 61}    2,776
{txt}{col 9}{hline 16}{c BT}{hline 44}

{col 49}Wald chi2({res}18{txt}){col 67}={col 70}{res}   679.71
{txt}Log likelihood = {res}-218364.51{col 49}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}         b11{col 14}{c |} Coefficient{col 26}  Std. err.{col 38}      z{col 46}   P>|z|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 4}v2x_poly {c |}{col 14}{res}{space 2}-.5086629{col 26}{space 2}  .615143{col 37}{space 1}   -0.83{col 46}{space 3}0.408{col 54}{space 4}-1.714321{col 67}{space 3} .6969953
{txt}{space 7}loser {c |}{col 14}{res}{space 2}-.5915622{col 26}{space 2}  .079907{col 37}{space 1}   -7.40{col 46}{space 3}0.000{col 54}{space 4}-.7481771{col 67}{space 3}-.4349474
{txt}{space 3}abstainer {c |}{col 14}{res}{space 2}-.4861157{col 26}{space 2} .0391374{col 37}{space 1}  -12.42{col 46}{space 3}0.000{col 54}{space 4}-.5628236{col 67}{space 3}-.4094077
{txt}{space 5}wt_grow {c |}{col 14}{res}{space 2}-.0108431{col 26}{space 2} .0126895{col 37}{space 1}   -0.85{col 46}{space 3}0.393{col 54}{space 4}-.0357141{col 67}{space 3} .0140278
{txt}{space 10}ur {c |}{col 14}{res}{space 2} .2210321{col 26}{space 2} .0127126{col 37}{space 1}   17.39{col 46}{space 3}0.000{col 54}{space 4}  .196116{col 67}{space 3} .2459483
{txt}{space 9}edu {c |}{col 14}{res}{space 2}-.0008346{col 26}{space 2} .0015209{col 37}{space 1}   -0.55{col 46}{space 3}0.583{col 54}{space 4}-.0038154{col 67}{space 3} .0021463
{txt}{space 4}quintall {c |}{col 14}{res}{space 2}-.0067624{col 26}{space 2} .0041974{col 37}{space 1}   -1.61{col 46}{space 3}0.107{col 54}{space 4}-.0149891{col 67}{space 3} .0014644
{txt}{space 6}female {c |}{col 14}{res}{space 2}-.0168288{col 26}{space 2} .0107593{col 37}{space 1}   -1.56{col 46}{space 3}0.118{col 54}{space 4}-.0379166{col 67}{space 3}  .004259
{txt}{space 5}age2635 {c |}{col 14}{res}{space 2}-.1319044{col 26}{space 2} .0157369{col 37}{space 1}   -8.38{col 46}{space 3}0.000{col 54}{space 4} -.162748{col 67}{space 3}-.1010607
{txt}{space 5}age3645 {c |}{col 14}{res}{space 2}-.1298411{col 26}{space 2} .0168115{col 37}{space 1}   -7.72{col 46}{space 3}0.000{col 54}{space 4} -.162791{col 67}{space 3}-.0968913
{txt}{space 5}age4655 {c |}{col 14}{res}{space 2}-.1293104{col 26}{space 2}  .018618{col 37}{space 1}   -6.95{col 46}{space 3}0.000{col 54}{space 4}-.1658011{col 67}{space 3}-.0928197
{txt}{space 5}age5665 {c |}{col 14}{res}{space 2}-.0571087{col 26}{space 2} .0215696{col 37}{space 1}   -2.65{col 46}{space 3}0.008{col 54}{space 4}-.0993844{col 67}{space 3}-.0148329
{txt}{space 7}age66 {c |}{col 14}{res}{space 2} .0138225{col 26}{space 2}  .024752{col 37}{space 1}    0.56{col 46}{space 3}0.577{col 54}{space 4}-.0346904{col 67}{space 3} .0623355
{txt}{space 5}mestizo {c |}{col 14}{res}{space 2}-.0559222{col 26}{space 2} .0141151{col 37}{space 1}   -3.96{col 46}{space 3}0.000{col 54}{space 4}-.0835873{col 67}{space 3}-.0282571
{txt}{space 5}indigen {c |}{col 14}{res}{space 2}-.0444827{col 26}{space 2} .0251912{col 37}{space 1}   -1.77{col 46}{space 3}0.077{col 54}{space 4}-.0938564{col 67}{space 3} .0048911
{txt}{space 7}black {c |}{col 14}{res}{space 2}-.0268745{col 26}{space 2} .0293731{col 37}{space 1}   -0.91{col 46}{space 3}0.360{col 54}{space 4}-.0844446{col 67}{space 3} .0306957
{txt}{space 5}mulatto {c |}{col 14}{res}{space 2}-.0332106{col 26}{space 2} .0314888{col 37}{space 1}   -1.05{col 46}{space 3}0.292{col 54}{space 4}-.0949276{col 67}{space 3} .0285064
{txt}{space 4}oth_race {c |}{col 14}{res}{space 2} .0380247{col 26}{space 2} .0406559{col 37}{space 1}    0.94{col 46}{space 3}0.350{col 54}{space 4}-.0416595{col 67}{space 3} .1177089
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 4.581939{col 26}{space 2} .4314092{col 37}{space 1}   10.62{col 46}{space 3}0.000{col 54}{space 4} 3.736393{col 67}{space 3} 5.427485
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{hline 29}{c TT}{hline 48}
{col 3}Random-effects parameters{col 30}{c |}{col 34}Estimate{col 45}Std. err.{col 59}[95% conf. interval]
{hline 29}{c +}{hline 48}
{res}pais{txt}: Identity{col 30}{c |}
{space 18}var(_cons) {c |}{res}{col 33} .2688673{col 44} .1150547{col 58} .1162221{col 70} .6219957
{txt}{hline 29}{c +}{hline 48}
{res}level2{txt}: Independent{col 30}{c |}
{space 18}var(loser) {c |}{res}{col 33} .5064524{col 44} .0823419{col 58} .3682523{col 70} .6965171
{txt}{space 14}var(abstainer) {c |}{res}{col 33} .1091882{col 44} .0194873{col 58} .0769588{col 70} .1549149
{txt}{space 18}var(_cons) {c |}{res}{col 33} .1329259{col 44} .0254287{col 58}  .091364{col 70} .1933944
{txt}{hline 29}{c +}{hline 48}
{col 16}var(Residual){col 30}{c |}{res}{col 33} 3.121998{col 44} .0133513{col 58} 3.095939{col 70} 3.148276
{txt}{hline 29}{c BT}{hline 48}
LR test vs. linear model:{col 27}chi2({res}4{txt}) = {res}10068.91{col 59}{txt}Prob > chi2 ={col 73}{res}0.0000

{txt}{p 0 6 4}Note: {help j_mixedlr##|_new:LR test is conservative} and provided only for reference.{p_end}

{com}.  
. mixed b11 C.v2x_poly##C.loser abstainer##C.v2x_poly  wt_grow ur edu quintall female  age2635 age3645 age4655 age5665 age66 mestizo indigen black mulatto oth_race || pais: || level2: loser abstainer
{txt}note: {bf:v2x_poly} omitted because of collinearity.
{res}
{txt}Performing EM optimization ...
{res}
{txt}Performing gradient-based optimization: {res}
{txt}Iteration 0:{space 3}log likelihood = {res:-218338.49}  
Iteration 1:{space 3}log likelihood = {res:-218338.49}  
{res}
{txt}Computing standard errors ...
{res}
{txt}Mixed-effects ML regression{col 49}Number of obs{col 67}={col 69}{res}   109,618

{txt}{col 9}Grouping information
{col 9}{hline 16}{c TT}{hline 44}
{col 25}{c |}{col 31}No. of{col 44}Observations per group
{col 10}Group variable{col 25}{c |}{col 31}groups{col 41}Minimum{col 52}Average{col 63}Maximum
{col 9}{hline 16}{c +}{hline 44}
{res}{col 20}pais{txt}{col 25}{c |}{res}{col 29}      18{col 39}    3,254{col 50}  6,089.9{col 61}   10,792
{col 18}level2{txt}{col 25}{c |}{res}{col 29}      82{col 39}      892{col 50}  1,336.8{col 61}    2,776
{txt}{col 9}{hline 16}{c BT}{hline 44}

{col 49}Wald chi2({res}20{txt}){col 67}={col 70}{res}   798.07
{txt}Log likelihood = {res}-218338.49{col 49}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{hline 21}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}                 b11{col 22}{c |} Coefficient{col 34}  Std. err.{col 46}      z{col 54}   P>|z|{col 62}     [95% con{col 75}f. interval]
{hline 21}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 12}v2x_poly {c |}{col 22}{res}{space 2} -.563149{col 34}{space 2} .6110862{col 45}{space 1}   -0.92{col 54}{space 3}0.357{col 62}{space 4}-1.760856{col 75}{space 3}  .634558
{txt}{space 15}loser {c |}{col 22}{res}{space 2}-2.477412{col 34}{space 2} .2609979{col 45}{space 1}   -9.49{col 54}{space 3}0.000{col 62}{space 4}-2.988958{col 75}{space 3}-1.965865
{txt}{space 20} {c |}
{space 2}c.v2x_poly#c.loser {c |}{col 22}{res}{space 2} 2.826189{col 34}{space 2} .3795978{col 45}{space 1}    7.45{col 54}{space 3}0.000{col 62}{space 4} 2.082191{col 75}{space 3} 3.570186
{txt}{space 20} {c |}
{space 9}1.abstainer {c |}{col 22}{res}{space 2}-.9816992{col 34}{space 2} .1524224{col 45}{space 1}   -6.44{col 54}{space 3}0.000{col 62}{space 4}-1.280442{col 75}{space 3}-.6829567
{txt}{space 12}v2x_poly {c |}{col 22}{res}{space 2}        0{col 34}{txt}  (omitted)
{space 20} {c |}
abstainer#c.v2x_poly {c |}
{space 18}1  {c |}{col 22}{res}{space 2} .7451884{col 34}{space 2} .2225618{col 45}{space 1}    3.35{col 54}{space 3}0.001{col 62}{space 4} .3089753{col 75}{space 3} 1.181401
{txt}{space 20} {c |}
{space 13}wt_grow {c |}{col 22}{res}{space 2} -.010861{col 34}{space 2} .0126144{col 45}{space 1}   -0.86{col 54}{space 3}0.389{col 62}{space 4}-.0355847{col 75}{space 3} .0138628
{txt}{space 18}ur {c |}{col 22}{res}{space 2} .2210974{col 34}{space 2} .0127121{col 45}{space 1}   17.39{col 54}{space 3}0.000{col 62}{space 4} .1961821{col 75}{space 3} .2460127
{txt}{space 17}edu {c |}{col 22}{res}{space 2}-.0008113{col 34}{space 2} .0015208{col 45}{space 1}   -0.53{col 54}{space 3}0.594{col 62}{space 4} -.003792{col 75}{space 3} .0021694
{txt}{space 12}quintall {c |}{col 22}{res}{space 2}-.0067356{col 34}{space 2} .0041973{col 45}{space 1}   -1.60{col 54}{space 3}0.109{col 62}{space 4}-.0149621{col 75}{space 3} .0014909
{txt}{space 14}female {c |}{col 22}{res}{space 2}-.0167969{col 34}{space 2} .0107591{col 45}{space 1}   -1.56{col 54}{space 3}0.118{col 62}{space 4}-.0378843{col 75}{space 3} .0042904
{txt}{space 13}age2635 {c |}{col 22}{res}{space 2}-.1320129{col 34}{space 2} .0157358{col 45}{space 1}   -8.39{col 54}{space 3}0.000{col 62}{space 4}-.1628545{col 75}{space 3}-.1011713
{txt}{space 13}age3645 {c |}{col 22}{res}{space 2}-.1297079{col 34}{space 2} .0168103{col 45}{space 1}   -7.72{col 54}{space 3}0.000{col 62}{space 4}-.1626554{col 75}{space 3}-.0967604
{txt}{space 13}age4655 {c |}{col 22}{res}{space 2}-.1289252{col 34}{space 2}  .018617{col 45}{space 1}   -6.93{col 54}{space 3}0.000{col 62}{space 4} -.165414{col 75}{space 3}-.0924365
{txt}{space 13}age5665 {c |}{col 22}{res}{space 2}-.0568206{col 34}{space 2} .0215686{col 45}{space 1}   -2.63{col 54}{space 3}0.008{col 62}{space 4}-.0990943{col 75}{space 3}-.0145469
{txt}{space 15}age66 {c |}{col 22}{res}{space 2} .0142982{col 34}{space 2} .0247499{col 45}{space 1}    0.58{col 54}{space 3}0.563{col 62}{space 4}-.0342107{col 75}{space 3}  .062807
{txt}{space 13}mestizo {c |}{col 22}{res}{space 2}-.0559407{col 34}{space 2} .0141149{col 45}{space 1}   -3.96{col 54}{space 3}0.000{col 62}{space 4}-.0836054{col 75}{space 3}-.0282761
{txt}{space 13}indigen {c |}{col 22}{res}{space 2}-.0445299{col 34}{space 2} .0251891{col 45}{space 1}   -1.77{col 54}{space 3}0.077{col 62}{space 4}-.0938997{col 75}{space 3} .0048399
{txt}{space 15}black {c |}{col 22}{res}{space 2}-.0266341{col 34}{space 2} .0293726{col 45}{space 1}   -0.91{col 54}{space 3}0.365{col 62}{space 4}-.0842033{col 75}{space 3} .0309352
{txt}{space 13}mulatto {c |}{col 22}{res}{space 2}-.0323745{col 34}{space 2} .0314879{col 45}{space 1}   -1.03{col 54}{space 3}0.304{col 62}{space 4}-.0940896{col 75}{space 3} .0293407
{txt}{space 12}oth_race {c |}{col 22}{res}{space 2} .0381518{col 34}{space 2} .0406554{col 45}{space 1}    0.94{col 54}{space 3}0.348{col 62}{space 4}-.0415314{col 75}{space 3}  .117835
{txt}{space 15}_cons {c |}{col 22}{res}{space 2} 4.617963{col 34}{space 2} .4285277{col 45}{space 1}   10.78{col 54}{space 3}0.000{col 62}{space 4} 3.778064{col 75}{space 3} 5.457862
{txt}{hline 21}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{hline 29}{c TT}{hline 48}
{col 3}Random-effects parameters{col 30}{c |}{col 34}Estimate{col 45}Std. err.{col 59}[95% conf. interval]
{hline 29}{c +}{hline 48}
{res}pais{txt}: Identity{col 30}{c |}
{space 18}var(_cons) {c |}{res}{col 33} .2645665{col 44} .1132156{col 58} .1143619{col 70}  .612052
{txt}{hline 29}{c +}{hline 48}
{res}level2{txt}: Independent{col 30}{c |}
{space 18}var(loser) {c |}{res}{col 33} .2971717{col 44}  .049296{col 58} .2146876{col 70} .4113467
{txt}{space 14}var(abstainer) {c |}{res}{col 33} .0934144{col 44} .0169953{col 58} .0653959{col 70} .1334372
{txt}{space 18}var(_cons) {c |}{res}{col 33} .1314071{col 44}   .02513{col 58}  .090331{col 70} .1911615
{txt}{hline 29}{c +}{hline 48}
{col 16}var(Residual){col 30}{c |}{res}{col 33} 3.122056{col 44} .0133518{col 58} 3.095996{col 70} 3.148335
{txt}{hline 29}{c BT}{hline 48}
LR test vs. linear model:{col 27}chi2({res}4{txt}) = {res}8991.89{col 59}{txt}Prob > chi2 ={col 73}{res}0.0000

{txt}{p 0 6 4}Note: {help j_mixedlr##|_new:LR test is conservative} and provided only for reference.{p_end}

{com}. quietly: margins , at(v2x_poly=(0.25(.05).95) loser=(0(1)1) abstainer=0 wt_grow=(3.65) ur=1 edu=9.37 quintall=2.957 female=1  age2635=1 age3645=0 age4655=0 age5665=0 age66=0 mestizo=1 indigen=0 black=0 mulatto=0 oth_race=0)
{txt}
{com}. marginsplot, recast(line) recastci(rline) xtitle( "Level of Democracy (V-Dem)") ytitle("Predicted Trust") title("Trust in Electoral Institutions") ciopts(lpattern(dash) lcolor(gs8)) ci2opts(lpattern(dash)) scheme(s1mono) plot2opts(lpattern(line) lcolor(black)) plotopts(lpattern(line) lcolor(gs8)) legend(rows(2))
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:v2x_poly loser}{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{res}{txt}
{com}. graph save "Graph" "C:\Users\mas07010\Dropbox\27 winners and losers and election quality\pop second revision\figure 3 trust electoral institutions.gph", replace
{txt}{p 0 4 2}
(file {bf}
C:\Users\mas07010\Dropbox\27 winners and losers and election quality\pop second revision\figure 3 trust electoral institutions.gph{rm}
not found)
{p_end}
{res}{txt}file {bf:C:\Users\mas07010\Dropbox\27 winners and losers and election quality\pop second revision\figure 3 trust electoral institutions.gph} saved

{com}. 
. ** model trust in elections
. 
. mixed b47a C.v2x_poly loser abstainer wt_grow ur edu quintall female  age2635 age3645 age4655 age5665 age66 mestizo indigen black mulatto oth_race || pais: || level2: loser abstainer 
{res}
{txt}Performing EM optimization ...
{res}
{txt}Performing gradient-based optimization: {res}
{txt}Iteration 0:{space 3}log likelihood = {res:-179105.68}  
Iteration 1:{space 3}log likelihood = {res:-179105.68}  
{res}
{txt}Computing standard errors ...
{res}
{txt}Mixed-effects ML regression{col 49}Number of obs{col 67}={col 69}{res}    89,373

{txt}{col 9}Grouping information
{col 9}{hline 16}{c TT}{hline 44}
{col 25}{c |}{col 31}No. of{col 44}Observations per group
{col 10}Group variable{col 25}{c |}{col 31}groups{col 41}Minimum{col 52}Average{col 63}Maximum
{col 9}{hline 16}{c +}{hline 44}
{res}{col 20}pais{txt}{col 25}{c |}{res}{col 29}      18{col 39}    3,083{col 50}  4,965.2{col 61}    6,382
{col 18}level2{txt}{col 25}{c |}{res}{col 29}      71{col 39}      896{col 50}  1,258.8{col 61}    2,218
{txt}{col 9}{hline 16}{c BT}{hline 44}

{col 49}Wald chi2({res}18{txt}){col 67}={col 70}{res}  1041.44
{txt}Log likelihood = {res}-179105.68{col 49}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}        b47a{col 14}{c |} Coefficient{col 26}  Std. err.{col 38}      z{col 46}   P>|z|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 4}v2x_poly {c |}{col 14}{res}{space 2} .0458046{col 26}{space 2} .6671476{col 37}{space 1}    0.07{col 46}{space 3}0.945{col 54}{space 4}-1.261781{col 67}{space 3}  1.35339
{txt}{space 7}loser {c |}{col 14}{res}{space 2}-.7125214{col 26}{space 2} .0848328{col 37}{space 1}   -8.40{col 46}{space 3}0.000{col 54}{space 4}-.8787908{col 67}{space 3}-.5462521
{txt}{space 3}abstainer {c |}{col 14}{res}{space 2}-.6595227{col 26}{space 2} .0454216{col 37}{space 1}  -14.52{col 46}{space 3}0.000{col 54}{space 4}-.7485474{col 67}{space 3} -.570498
{txt}{space 5}wt_grow {c |}{col 14}{res}{space 2} .0238184{col 26}{space 2} .0147913{col 37}{space 1}    1.61{col 46}{space 3}0.107{col 54}{space 4}-.0051721{col 67}{space 3} .0528088
{txt}{space 10}ur {c |}{col 14}{res}{space 2}   .25164{col 26}{space 2} .0145019{col 37}{space 1}   17.35{col 46}{space 3}0.000{col 54}{space 4} .2232168{col 67}{space 3} .2800632
{txt}{space 9}edu {c |}{col 14}{res}{space 2} .0034632{col 26}{space 2}  .001732{col 37}{space 1}    2.00{col 46}{space 3}0.046{col 54}{space 4} .0000685{col 67}{space 3} .0068578
{txt}{space 4}quintall {c |}{col 14}{res}{space 2}-.0079259{col 26}{space 2} .0047188{col 37}{space 1}   -1.68{col 46}{space 3}0.093{col 54}{space 4}-.0171745{col 67}{space 3} .0013227
{txt}{space 6}female {c |}{col 14}{res}{space 2}-.1192635{col 26}{space 2} .0120733{col 37}{space 1}   -9.88{col 46}{space 3}0.000{col 54}{space 4}-.1429268{col 67}{space 3}-.0956002
{txt}{space 5}age2635 {c |}{col 14}{res}{space 2}-.2096819{col 26}{space 2}  .018029{col 37}{space 1}  -11.63{col 46}{space 3}0.000{col 54}{space 4} -.245018{col 67}{space 3}-.1743458
{txt}{space 5}age3645 {c |}{col 14}{res}{space 2}-.1408694{col 26}{space 2} .0192838{col 37}{space 1}   -7.31{col 46}{space 3}0.000{col 54}{space 4}-.1786651{col 67}{space 3}-.1030738
{txt}{space 5}age4655 {c |}{col 14}{res}{space 2}-.1098846{col 26}{space 2} .0209738{col 37}{space 1}   -5.24{col 46}{space 3}0.000{col 54}{space 4}-.1509926{col 67}{space 3}-.0687766
{txt}{space 5}age5665 {c |}{col 14}{res}{space 2} .0148388{col 26}{space 2} .0238478{col 37}{space 1}    0.62{col 46}{space 3}0.534{col 54}{space 4} -.031902{col 67}{space 3} .0615797
{txt}{space 7}age66 {c |}{col 14}{res}{space 2} .1631201{col 26}{space 2} .0262078{col 37}{space 1}    6.22{col 46}{space 3}0.000{col 54}{space 4} .1117538{col 67}{space 3} .2144864
{txt}{space 5}mestizo {c |}{col 14}{res}{space 2} -.067505{col 26}{space 2} .0156415{col 37}{space 1}   -4.32{col 46}{space 3}0.000{col 54}{space 4}-.0981619{col 67}{space 3}-.0368481
{txt}{space 5}indigen {c |}{col 14}{res}{space 2}-.1296191{col 26}{space 2} .0273862{col 37}{space 1}   -4.73{col 46}{space 3}0.000{col 54}{space 4}-.1832951{col 67}{space 3}-.0759432
{txt}{space 7}black {c |}{col 14}{res}{space 2}-.1493062{col 26}{space 2} .0296288{col 37}{space 1}   -5.04{col 46}{space 3}0.000{col 54}{space 4}-.2073776{col 67}{space 3}-.0912349
{txt}{space 5}mulatto {c |}{col 14}{res}{space 2}  -.08004{col 26}{space 2} .0305364{col 37}{space 1}   -2.62{col 46}{space 3}0.009{col 54}{space 4}-.1398902{col 67}{space 3}-.0201897
{txt}{space 4}oth_race {c |}{col 14}{res}{space 2}-.0456079{col 26}{space 2} .0375169{col 37}{space 1}   -1.22{col 46}{space 3}0.224{col 54}{space 4}-.1191397{col 67}{space 3} .0279239
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 4.114218{col 26}{space 2} .4572181{col 37}{space 1}    9.00{col 46}{space 3}0.000{col 54}{space 4} 3.218087{col 67}{space 3} 5.010349
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{hline 29}{c TT}{hline 48}
{col 3}Random-effects parameters{col 30}{c |}{col 34}Estimate{col 45}Std. err.{col 59}[95% conf. interval]
{hline 29}{c +}{hline 48}
{res}pais{txt}: Identity{col 30}{c |}
{space 18}var(_cons) {c |}{res}{col 33} .3058242{col 44} .1127183{col 58} .1485055{col 70} .6297978
{txt}{hline 29}{c +}{hline 48}
{res}level2{txt}: Independent{col 30}{c |}
{space 18}var(loser) {c |}{res}{col 33} .4921185{col 44} .0864641{col 58}  .348751{col 70} .6944228
{txt}{space 14}var(abstainer) {c |}{res}{col 33} .1292578{col 44} .0245184{col 58} .0891243{col 70} .1874639
{txt}{space 18}var(_cons) {c |}{res}{col 33} .0965292{col 44} .0201084{col 58} .0641713{col 70} .1452032
{txt}{hline 29}{c +}{hline 48}
{col 16}var(Residual){col 30}{c |}{res}{col 33} 3.196713{col 44} .0151415{col 58} 3.167174{col 70} 3.226528
{txt}{hline 29}{c BT}{hline 48}
LR test vs. linear model:{col 27}chi2({res}4{txt}) = {res}7908.90{col 59}{txt}Prob > chi2 ={col 73}{res}0.0000

{txt}{p 0 6 4}Note: {help j_mixedlr##|_new:LR test is conservative} and provided only for reference.{p_end}

{com}.  
. mixed b47a C.v2x_poly##C.loser abstainer##C.v2x_poly wt_grow ur edu quintall female  age2635 age3645 age4655 age5665 age66 mestizo indigen black mulatto oth_race || pais: || level2: loser abstainer
{txt}note: {bf:v2x_poly} omitted because of collinearity.
{res}
{txt}Performing EM optimization ...
{res}
{txt}Performing gradient-based optimization: {res}
{txt}Iteration 0:{space 3}log likelihood = {res:-179068.04}  
Iteration 1:{space 3}log likelihood = {res:-179068.04}  
{res}
{txt}Computing standard errors ...
{res}
{txt}Mixed-effects ML regression{col 49}Number of obs{col 67}={col 69}{res}    89,373

{txt}{col 9}Grouping information
{col 9}{hline 16}{c TT}{hline 44}
{col 25}{c |}{col 31}No. of{col 44}Observations per group
{col 10}Group variable{col 25}{c |}{col 31}groups{col 41}Minimum{col 52}Average{col 63}Maximum
{col 9}{hline 16}{c +}{hline 44}
{res}{col 20}pais{txt}{col 25}{c |}{res}{col 29}      18{col 39}    3,083{col 50}  4,965.2{col 61}    6,382
{col 18}level2{txt}{col 25}{c |}{res}{col 29}      71{col 39}      896{col 50}  1,258.8{col 61}    2,218
{txt}{col 9}{hline 16}{c BT}{hline 44}

{col 49}Wald chi2({res}20{txt}){col 67}={col 70}{res}  1289.64
{txt}Log likelihood = {res}-179068.04{col 49}{txt}Prob > chi2{col 67}={col 73}{res}0.0000

{txt}{hline 21}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}                b47a{col 22}{c |} Coefficient{col 34}  Std. err.{col 46}      z{col 54}   P>|z|{col 62}     [95% con{col 75}f. interval]
{hline 21}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 12}v2x_poly {c |}{col 22}{res}{space 2}-.0478224{col 34}{space 2} .6595893{col 45}{space 1}   -0.07{col 54}{space 3}0.942{col 62}{space 4}-1.340594{col 75}{space 3} 1.244949
{txt}{space 15}loser {c |}{col 22}{res}{space 2}-2.861994{col 34}{space 2} .2379504{col 45}{space 1}  -12.03{col 54}{space 3}0.000{col 62}{space 4}-3.328368{col 75}{space 3} -2.39562
{txt}{space 20} {c |}
{space 2}c.v2x_poly#c.loser {c |}{col 22}{res}{space 2} 3.195975{col 34}{space 2} .3428436{col 45}{space 1}    9.32{col 54}{space 3}0.000{col 62}{space 4} 2.524014{col 75}{space 3} 3.867936
{txt}{space 20} {c |}
{space 9}1.abstainer {c |}{col 22}{res}{space 2}-1.414469{col 34}{space 2} .1622782{col 45}{space 1}   -8.72{col 54}{space 3}0.000{col 62}{space 4}-1.732529{col 75}{space 3} -1.09641
{txt}{space 12}v2x_poly {c |}{col 22}{res}{space 2}        0{col 34}{txt}  (omitted)
{space 20} {c |}
abstainer#c.v2x_poly {c |}
{space 18}1  {c |}{col 22}{res}{space 2} 1.123996{col 34}{space 2} .2344295{col 45}{space 1}    4.79{col 54}{space 3}0.000{col 62}{space 4}  .664523{col 75}{space 3}  1.58347
{txt}{space 20} {c |}
{space 13}wt_grow {c |}{col 22}{res}{space 2} .0234726{col 34}{space 2} .0146335{col 45}{space 1}    1.60{col 54}{space 3}0.109{col 62}{space 4}-.0052086{col 75}{space 3} .0521538
{txt}{space 18}ur {c |}{col 22}{res}{space 2} .2515288{col 34}{space 2} .0145007{col 45}{space 1}   17.35{col 54}{space 3}0.000{col 62}{space 4} .2231079{col 75}{space 3} .2799497
{txt}{space 17}edu {c |}{col 22}{res}{space 2} .0035287{col 34}{space 2} .0017318{col 45}{space 1}    2.04{col 54}{space 3}0.042{col 62}{space 4} .0001344{col 75}{space 3}  .006923
{txt}{space 12}quintall {c |}{col 22}{res}{space 2}-.0077854{col 34}{space 2} .0047185{col 45}{space 1}   -1.65{col 54}{space 3}0.099{col 62}{space 4}-.0170334{col 75}{space 3} .0014626
{txt}{space 14}female {c |}{col 22}{res}{space 2}-.1193045{col 34}{space 2} .0120727{col 45}{space 1}   -9.88{col 54}{space 3}0.000{col 62}{space 4}-.1429666{col 75}{space 3}-.0956424
{txt}{space 13}age2635 {c |}{col 22}{res}{space 2}-.2098973{col 34}{space 2} .0180259{col 45}{space 1}  -11.64{col 54}{space 3}0.000{col 62}{space 4}-.2452275{col 75}{space 3}-.1745671
{txt}{space 13}age3645 {c |}{col 22}{res}{space 2}-.1412572{col 34}{space 2} .0192804{col 45}{space 1}   -7.33{col 54}{space 3}0.000{col 62}{space 4}-.1790462{col 75}{space 3}-.1034683
{txt}{space 13}age4655 {c |}{col 22}{res}{space 2}-.1096781{col 34}{space 2} .0209714{col 45}{space 1}   -5.23{col 54}{space 3}0.000{col 62}{space 4}-.1507813{col 75}{space 3}-.0685749
{txt}{space 13}age5665 {c |}{col 22}{res}{space 2} .0151188{col 34}{space 2} .0238456{col 45}{space 1}    0.63{col 54}{space 3}0.526{col 62}{space 4}-.0316176{col 75}{space 3} .0618553
{txt}{space 15}age66 {c |}{col 22}{res}{space 2} .1634461{col 34}{space 2} .0262042{col 45}{space 1}    6.24{col 54}{space 3}0.000{col 62}{space 4} .1120868{col 75}{space 3} .2148053
{txt}{space 13}mestizo {c |}{col 22}{res}{space 2}-.0681573{col 34}{space 2} .0156407{col 45}{space 1}   -4.36{col 54}{space 3}0.000{col 62}{space 4}-.0988126{col 75}{space 3} -.037502
{txt}{space 13}indigen {c |}{col 22}{res}{space 2}-.1297287{col 34}{space 2} .0273826{col 45}{space 1}   -4.74{col 54}{space 3}0.000{col 62}{space 4}-.1833976{col 75}{space 3}-.0760598
{txt}{space 15}black {c |}{col 22}{res}{space 2}-.1499813{col 34}{space 2} .0296277{col 45}{space 1}   -5.06{col 54}{space 3}0.000{col 62}{space 4}-.2080506{col 75}{space 3} -.091912
{txt}{space 13}mulatto {c |}{col 22}{res}{space 2}-.0802305{col 34}{space 2} .0305344{col 45}{space 1}   -2.63{col 54}{space 3}0.009{col 62}{space 4}-.1400768{col 75}{space 3}-.0203841
{txt}{space 12}oth_race {c |}{col 22}{res}{space 2}-.0457775{col 34}{space 2} .0375162{col 45}{space 1}   -1.22{col 54}{space 3}0.222{col 62}{space 4}-.1193079{col 75}{space 3} .0277529
{txt}{space 15}_cons {c |}{col 22}{res}{space 2} 4.177954{col 34}{space 2} .4520385{col 45}{space 1}    9.24{col 54}{space 3}0.000{col 62}{space 4} 3.291975{col 75}{space 3} 5.063933
{txt}{hline 21}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{hline 29}{c TT}{hline 48}
{col 3}Random-effects parameters{col 30}{c |}{col 34}Estimate{col 45}Std. err.{col 59}[95% conf. interval]
{hline 29}{c +}{hline 48}
{res}pais{txt}: Identity{col 30}{c |}
{space 18}var(_cons) {c |}{res}{col 33} .2982327{col 44} .1099881{col 58} .1447547{col 70} .6144378
{txt}{hline 29}{c +}{hline 48}
{res}level2{txt}: Independent{col 30}{c |}
{space 18}var(loser) {c |}{res}{col 33} .2123362{col 44} .0390579{col 58} .1480646{col 70} .3045069
{txt}{space 14}var(abstainer) {c |}{res}{col 33}  .093337{col 44} .0184082{col 58} .0634129{col 70} .1373822
{txt}{space 18}var(_cons) {c |}{res}{col 33} .0945786{col 44} .0196917{col 58}  .062888{col 70} .1422385
{txt}{hline 29}{c +}{hline 48}
{col 16}var(Residual){col 30}{c |}{res}{col 33}  3.19682{col 44} .0151425{col 58} 3.167278{col 70} 3.226637
{txt}{hline 29}{c BT}{hline 48}
LR test vs. linear model:{col 27}chi2({res}4{txt}) = {res}6696.35{col 59}{txt}Prob > chi2 ={col 73}{res}0.0000

{txt}{p 0 6 4}Note: {help j_mixedlr##|_new:LR test is conservative} and provided only for reference.{p_end}

{com}. quietly: margins , at(v2x_poly=(0.25(.05).95) loser=(0(1)1) abstainer=0 wt_grow=(3.65) ur=1 edu=9.37 quintall=2.957 female=1  age2635=1 age3645=0 age4655=0 age5665=0 age66=0 mestizo=1 indigen=0 black=0 mulatto=0 oth_race=0)
{txt}
{com}. marginsplot, recast(line) recastci(rline) xtitle( "Level of Democracy (V-Dem)") ytitle("Predicted Trust") title("Trust in Elections") ciopts(lpattern(dash) lcolor(gs8)) ci2opts(lpattern(dash)) scheme(s1mono) plot2opts(lpattern(line) lcolor(black)) plotopts(lpattern(line) lcolor(gs8)) legend(rows(2))
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:v2x_poly loser}{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{p 0 4 2}
{txt}(note:  named style
line not found in class
linepattern,  default attributes used)
{p_end}
{res}{txt}
{com}. graph save "Graph" "C:\Users\mas07010\Dropbox\27 winners and losers and election quality\pop second revision\figure 3 trust elections.gph", replace
{res}{txt}file {bf:C:\Users\mas07010\Dropbox\27 winners and losers and election quality\pop second revision\figure 3 trust elections.gph} saved

{com}. 
. *note that the graphs will not do the full range of the variable automatically. So I change the y-axis ranges by hand, putting in their label values from appendix 1
. 
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\mas07010\Dropbox\27 winners and losers and election quality\pop second revision\lapop models.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}30 Jul 2021, 15:36:41
{txt}{.-}
{smcl}
{txt}{sf}{ul off}